InsertMovieSegment
TheInsertMovieSegment
function copies part of one movie to another. You specify the starting time and duration of the source segment and the time in the destination movie at which to place the information.
pascal OSErr InsertMovieSegment (Movie srcMovie, Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn);
srcMovie
- Specifies the source movie for this operation. Your application obtains this movie identifier from such functions as
NewMovie
,NewMovieFromFile
, andNewMovieFromHandle
(described on page 2-80, page 2-76, and page 2-78, respectively). TheInsertMovieSegment
function obtains the movie segment from the source movie specified in this parameter.dstMovie
- Specifies the destination movie for this operation. The
InsertMovieSegment
function places a copy of the segment, which is obtained from the source movie, into this destination movie. ThedstIn
parameter specifies where the segment is inserted.srcIn
- Specifies the start of the segment in the source movie. The
srcDuration
parameter specifies the segment's duration. This time value must be expressed in the source movie's time scale.srcDuration
- Specifies the duration of the segment in the source movie. This time value must be expressed in the source movie's time scale.
dstIn
- Contains a time value specifying where the segment is to be inserted. This time value must be expressed in the destination movie's time scale.
DESCRIPTION
TheInsertMovieSegment
function does not change the source movie. However, the duration of the destination movie is extended to accommodate the inserted segment. You can use this function to add a segment beyond the end of the destination movie--the Movie Toolbox inserts empty space as appropriate.You can use the
InsertMovieSegment
function to copy data within a single movie. If you are not copying data from one location in a movie to a different point in the same movie, the function may create new tracks, as appropriate.Whenever possible, the Movie Toolbox uses existing tracks to store the data to be inserted. Before adding a track to the destination movie, the toolbox looks in the destination movie for tracks that have the same characteristics as the tracks in the source movie. The toolbox considers the following characteristics when searching for an appropriate track:
If the Movie Toolbox cannot find an appropriate track in the destination movie, it creates a track with the proper characteristics.
- track spatial dimensions
- track matrix
- track clipping region
- track matte
- alternate group affiliation
- media time scale
- media type
- media language
- data reference (that is, the two tracks must refer to the same file)
If you have assigned a progress function to the destination movie, the Movie Toolbox calls that progress function during long copy operations. For details on application-defined progress functions, see "Progress Functions" beginning on page 2-333.
ERROR CODES
Memory Manager errors
invalidMovie -2010 This movie is corrupted or invalid invalidDuration -2014 This duration value is invalid invalidTime -2015 This time value is invalid progressProcAborted -2019 Your progress function returned an error